﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using DataAccess;
using Entities;

namespace BusinessLogic.ProfileManagementLogic
{
    public class ClientProfileManagementLogic
    {
        ClientDao clientDao=new ClientDao();
        public DataTable GetAllClient()
        {
            try
            {
                return clientDao.GetAllClient();
            }
            catch (SqlException sqlException)
            {
                return null;
            }
        }

        public DataTable GetClientById(string id)
        {
            try
            {
                return clientDao.GetClientById(id);
            }
            catch (SqlException sqlException)
            {
                return null;
            }
        }
        public int InsertClient(Client client)
        {
            try
            {
                return clientDao.InsertClient(client);
            }
            catch (Exception)
            {
                return 0;
            }
        }

        public int UpdateClient(Client client)
        {
            try
            {
                return clientDao.UpdateClient(client);
            }
            catch (Exception)
            {
                return 0;
            }
        }
        public int DeleteClient(Client client)
        {
            try
            {
                return clientDao.DeleteClient(client);
            }
            catch (Exception)
            {
                return 0;
            }
        }
    }
}
